//
//  YMFHomeViewController.swift
//  FlyingPigeon
//
//  Created by yang on 2019/5/22.
//  Copyright © 2019年 a. All rights reserved.
//

import Foundation
import UIKit


class YMFHomeViewController: UIViewController {
    
    @IBOutlet weak var selectCarView: UIView!
    
    @IBOutlet weak var selectPointView: UIView!
    
    @IBOutlet weak var specialPriceCarView: UIView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        navigationItem.title = "飞鸽租车"
        
        selectCarView.isUserInteractionEnabled = true
        let tap1 = UITapGestureRecognizer(target: self, action: #selector(tapAction(_:)))
        selectCarView.addGestureRecognizer(tap1)
        
         let tap2 = UITapGestureRecognizer(target: self, action: #selector(tapAction(_:)))
        selectPointView.addGestureRecognizer(tap2)
        
         let tap3 = UITapGestureRecognizer(target: self, action: #selector(tapAction(_:)))
        specialPriceCarView.addGestureRecognizer(tap3)
        
        
    }
    

    
    @objc func tapAction(_ tapGes: UITapGestureRecognizer) {
        guard let tapView = tapGes.view else {
            return
        }
        
        if tapView == selectCarView {
            navigationController?.pushViewController(YMFPriceInfoViewController(), animated: true)
        } else if tapView == selectPointView {
            let vc = YMFPlaceViewController()
            navigationController?.pushViewController(vc, animated: true)
            
        } else if tapView == specialPriceCarView {
            
            let vc = YMFPriceInfoViewController()
            vc.isSpecialPrice = true
            navigationController?.pushViewController(vc, animated: true)
        }
    }
}
